﻿using System;

namespace Eldert.IoT.Windows.ShipsEventProcessor
{
    /// <summary>
    /// Class used for writing to the console.
    /// </summary>
    public class Console
    {
        /// <summary>
        /// Write a message to the console.
        /// </summary>
        public static void WriteLine(string message)
        {
            WriteColoredLine(message, ConsoleColor.Gray);
        }

        /// <summary>
        /// Write a message to the console in color.
        /// </summary>
        public static void WriteColoredLine(string message, ConsoleColor color)
        {
            System.Console.ForegroundColor = color;
            System.Console.WriteLine(message);
            System.Console.ForegroundColor = ConsoleColor.Gray;
        }

        /// <summary>
        /// Write error message to the console.
        /// </summary>
        public static void WriteError(string message)
        {
            WriteColoredLine(message, ConsoleColor.Red);
        }

        /// <summary>
        /// Write warning message to the console.
        /// </summary>
        public static void WriteWarning(string message)
        {
            WriteColoredLine(message, ConsoleColor.Yellow);
        }

        /// <summary>
        /// Write information message to the console.
        /// </summary>
        public static void WriteInformation(string message)
        {
            WriteColoredLine(message, ConsoleColor.Cyan);
        }

        /// <summary>
        /// Read key pressed in console.
        /// </summary>
        public static void ReadKey()
        {
            System.Console.ReadKey();
        }
    }
}
